-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

local Object = require "mod.class.Object"

defineTile('>', 'DOWN')
defineTile('<', 'UP')
defineTile('#', 'WALL')
defineTile('*', 'WALL', nil, 'EMERGENCY_LIGHT', nil, nil, {type="light", subtype="emergency"})
defineTile('.', 'FLOOR')
defineTile('o', 'WINDOWED_DOOR')
defineTile('+', 'WOODEN_DOOR')
defineTile('=', 'DESK')
defineTile('B', 'BED')
defineTile('p', 'BED', nil, 'PATIENT')

-- Add the Chief of Virology
defineTile('c', 'WINDOWED_DOOR_OPENED', nil, 'CHIEF_OF_VIROLOGY')

-- Add signs
local newSign = function(tooltip)
		return Object.new{show_tooltip=true, tooltip=tooltip, name='sign', display='?', color=colors.GREY}
	end
defineTile('1', 'WALL', newSign("Room 1"))
defineTile('2', 'WALL', newSign("Room 2"))
defineTile('3', 'WALL', newSign("Room 3"))
defineTile('4', 'WALL', newSign("Room 4"))
defineTile('5', 'WALL', newSign("Room 5"))
defineTile('6', 'WALL', newSign("Room 6"))
defineTile('7', 'WALL', newSign("Room 7"))
defineTile('8', 'WALL', newSign("Room 8"))
defineTile('9', 'WALL', newSign("Room 9"))
defineTile('0', 'WALL', newSign("Room 10"))
defineTile('~', 'WALL', newSign("Room 11"))
defineTile('!', 'WALL', newSign("Room 12"))
defineTile('H', 'WALL', newSign("#RED#Biohazard Hard"))
defineTile('S', 'WALL', newSign("Security Station"))

-- Add the anti-virals
defineTile('a', 'FLOOR', 'ANTI_VIRALS')

-- Add the lockdown button
local button = Object.new{
	name="Lockdown Button",
	desc=[[A giant red button with the words "LOCKDOWN" written above it.]],
	display='x', color=colors.RED,
	can_talk = "lockdown",
	show_tooltip=true,
	type = "button", subtype="button",
}
defineTile('b', 'FLOOR', button)

-- Add the stairs
addSpot({31, 1}, 'stairs', 'a')
addSpot({33, 1}, 'stairs', 'b')
addSpot({64, 1}, 'stairs', 'c')
addSpot({66, 1}, 'stairs', 'd')
addSpot({31, 37}, 'stairs', 'e')
addSpot({33, 37}, 'stairs', 'f')
addSpot({64, 37}, 'stairs', 'g')
addSpot({66, 37}, 'stairs', 'h')

-- Add the elevator doors and buttons
defineTile('E', 'ELEVATOR_DOOR')
local button = Object.new{
	name="Elevator Button",
	desc=[[A panel of buttons.]],
	display='x', color=colors.SLATE,
	can_talk = "elevator",
	show_tooltip=true,
	type = "button", subtype="button",
}
defineTile('e', 'WALL', button)

-- Add the ward doors
defineTile('I', 'WINDOWED_DOOR', nil, nil, nil, nil, {type="biohazard doors", subtype="inner"})
defineTile('O', 'WINDOWED_DOOR', nil, nil, nil, nil, {type="biohazard doors", subtype="outer"})
defineTile('f', 'FLOOR', nil, nil, nil, nil, {type="quests", subtype="decontamination start"})
defineTile('s', 'FLOOR', nil, nil, nil, nil, {type="quests", subtype="lockdown safety"})

-- Add the Chief of Medicine location
defineTile('C', 'FLOOR', nil, nil, nil, nil, {type="quests", subtype="chief of medicine"})

startx = 32
starty = 10
endx = 32
endy = 10

return [[
##################################################################################################
#.pB.#.BB.#.BB.#.BB.#.BB.#.BB.#<#>##############################<#>#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#.*.##############################.*.#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
##6c#*#o5#*#4o#*#o3#*#2o#*#o1###o################################o###1o#*#o2#*#3o#*#o4#*#5o#*#o6##
#.............................#....................................#.............................#
#.............................#....................................#.............................#
#...a=====.=====.======....b###....................................#....=====.=====.======.......#
#....=................=...f.I.OC..##########################S+##...o....=................=.......#
#....=................=.....IsOs..#########################....#...o....=................=.......#
#....=====.=====.======.....##H...#########################....#...#....=====.=====.======.......#
#.............................#...#########################....=...#.............................#
#.............................#...#########################....=...#.............................#
##7o#*#o8#*#9o#*#o0#*#~o#*#o!##...#########################....=...##!o#*#o~#*#0o#*#o9#*#8o#*#o7##
#....#....#....#....#....#....#...###########...#...#######....#...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...e...#######....#...#....#....#....#....#....#....#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#...############E#*#E#########S+##...#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#....................................#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
###############################....................................###############################
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#....................................#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#...############E#*#E#############...#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#....#....#....#....#....#....#...###########...e...############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...#...############...#....#....#....#....#....#....#
##6o#*#o5#*#4o#*#o3#*#2o#*#o1##...##############################...##1o#*#o2#*#3o#*#o4#*#5o#*#o6##
#.............................#...##############################...#.............................#
#.............................#...##############################...#.............................#
#....=====.=====.======.......#...##############################...#....=====.=====.======.......#
#....=................=.......o...##############################...o....=................=.......#
#....=................=.......o...##############################...o....=................=.......#
#....=====.=====.======.......#....................................#....=====.=====.======.......#
#.............................#....................................#.............................#
#.............................#....................................#.............................#
##7o#*#o8#*#9o#*#o0#*#~o#*#o!###o################################o###!o#*#o~#*#0o#*#o9#*#8o#*#o7##
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#.*.##############################.*.#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#<#>##############################<#>#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
##################################################################################################]]